FROM golang:alpine as build-env
#加速访问
RUN go env -w GOPROXY=https://goproxy.cn,direct

ADD . /src
RUN cd /src && go build -o goapp

FROM alpine
WORKDIR /app
COPY --from=build-env /src/goapp /app/

ENTRYPOINT ./goapp